Class CF.NUR.MNISV3.Template Extends %Persistent
{

Property TemplateCode As %String(TRUNCATE = 1);

Property HospitalId As %String(TRUNCATE = 1);

Property BackgroundColor As %String(TRUNCATE = 1);

Property Color As %String(TRUNCATE = 1);

Property FontSize As %String(TRUNCATE = 1);

Property FontStyle As %String(TRUNCATE = 1);

Property FontWeight As %String(TRUNCATE = 1);

Property FormCode As %String(TRUNCATE = 1);

Property FormName As %String(TRUNCATE = 1);

Property FormStyle As %String(TRUNCATE = 1);

Property FormType As %String(TRUNCATE = 1);

Property Margin As %String(TRUNCATE = 1);

Index Code On (HospitalId, TemplateCode);

/// d ##class(CF.NUR.MNISV3.Node).Save("滴速","Speed",2,"INF","E","","1")
/// d ##class(CF.NUR.MNISV3.Node).Save("单位","Unit",2,"INF","R","","")
/// d ##class(CF.NUR.MNISV3.Template).Save("备注","Note",2,"INF","E","","")
ClassMethod Save(Code As %String, HospitalId As %String, BackgroundColor As %String, Color As %String, FontSize As %String, FontStyle As %String, FontWeight As %String, FormCode As %String, FormName As %String, FormStyle As %String, FormType As %String, Margin As %String) As %String
{
	s rw=""  //$o(^CF.NUR.MNISV3.TemplateI("Code"," "_HospitalId," "_$ZCVT(Code,"U"),""))
	i rw'="" s obj=##class(CF.NUR.MNISV3.Template).%OpenId(rw)
	e  s obj=##class(CF.NUR.MNISV3.Template).%New()
	
	s obj.TemplateCode=Code
	s obj.HospitalId=HospitalId
	s obj.BackgroundColor=BackgroundColor
	s obj.Color=Color
	s obj.FontSize=FontSize
	s obj.FontStyle=FontStyle
	s obj.FontWeight=FontWeight
	s obj.FormCode=FormCode
	s obj.FormName=FormName
	s obj.FormStyle=FormStyle
	s obj.FormType=FormType
	s obj.FontStyle=FontStyle
	s obj.Margin=Margin
	d obj.%Save()
	q obj.%Id()
}

ClassMethod DeleteData(rw As %String) As %String
{
	q:rw="" 0
	s a=##class(CF.NUR.MNISV3.Template).%DeleteId(rw)
	q 1
}

Storage Default
{
<Data name="TemplateDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>TemplateCode</Value>
</Value>
<Value name="3">
<Value>HospitalId</Value>
</Value>
<Value name="4">
<Value>ItemCode</Value>
</Value>
<Value name="5">
<Value>ItemType</Value>
</Value>
<Value name="6">
<Value>ItemValue</Value>
</Value>
<Value name="7">
<Value>BackgroundColor</Value>
</Value>
<Value name="8">
<Value>Color</Value>
</Value>
<Value name="9">
<Value>FontSize</Value>
</Value>
<Value name="10">
<Value>FontStyle</Value>
</Value>
<Value name="11">
<Value>FontWeight</Value>
</Value>
<Value name="12">
<Value>FormCode</Value>
</Value>
<Value name="13">
<Value>FormName</Value>
</Value>
<Value name="14">
<Value>FormStyle</Value>
</Value>
<Value name="15">
<Value>FormType</Value>
</Value>
<Value name="16">
<Value>Margin</Value>
</Value>
</Data>
<DataLocation>^CF.NUR.MNISV3.TemplateD</DataLocation>
<DefaultData>TemplateDefaultData</DefaultData>
<ExtentSize>4</ExtentSize>
<IdLocation>^CF.NUR.MNISV3.TemplateD</IdLocation>
<IndexLocation>^CF.NUR.MNISV3.TemplateI</IndexLocation>
<Property name="%%CLASSNAME">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="%%ID">
<AverageFieldSize>3</AverageFieldSize>
<Selectivity>1</Selectivity>
</Property>
<Property name="BackgroundColor">
<AverageFieldSize>3</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="Color">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FontSize">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FontStyle">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FontWeight">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FormCode">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FormName">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FormStyle">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FormType">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="HospitalId">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="Margin">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="TemplateCode">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<SQLMap name="Code">
<BlockCount>-4</BlockCount>
</SQLMap>
<SQLMap name="IDKEY">
<BlockCount>-4</BlockCount>
</SQLMap>
<StreamLocation>^CF.NUR.MNISV3.TemplateS</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}
